import 'package:flutter/material.dart';

import 'macd_chart.dart';

class MacdDemo extends StatefulWidget {
  const MacdDemo({super.key});

  @override
  State<MacdDemo> createState() => _MacdDemoState();
}

class _MacdDemoState extends State<MacdDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('MACD Demo')),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: MACDChart(
            // 假设你有更长时间的数据，比如
            closingPrices: const [
              23.0,
              24.0,
              25.0,
              26.0,
              27.0,
              28.0,
              29.0,
              30.0,
              31.0,
              32.0,
              33.0,
              34.0,
              35.0,
              36.0,
              37.0,
              38.0,
              39.0,
              40.0,
              41.0,
              42.0,
              43.0,
              44.0,
              45.0,
              46.0,
              47.0,
              48.0,
              49.0,
              50.0,
              51.0,
              52.0,
              53.0,
              54.0,
              55.0,
              56.0,
              57.0,
              58.0,
              59.0,
              60.0
            ]),
      ),
    );
  }
}
